package com.sykj.springboot.test.designMode.factoryMethodPattern;

public class main {


    /**
     * @author lining
     * @date 2022/5/30 14:35
     * @description 工厂模式
     **/
    public static void main(String[] args) {
        Human human = HumanFactory.createHuman(YHuman.class);
        human.money();
        human.say();
        human.walk();

        Human human2 = HumanFactory.createHuman(WHuman.class);
        human2.money();
        human2.say();
        human2.walk();


        Human human3 = HumanFactory.createHuman(BHuman.class);
        human3.money();
        human3.say();
        human3.walk();

        /*for (int i = 0; i < 100; i++) {
            Human human4 = HumanFactory.createHuman();
            human4.money();
            human4.say();
            human4.walk();
        }*/

    }

}
